Digitizing II: Rooms at CPH
Introduction
For this lab, you'll be digitizing a portion of the CPH campus for use in a CPH online map. You'll want to take your time and carefully digitize the features as they will be visible to anyone using the map. To make sure the digitizing is done well, you'll be working in groups of two and then QAQCing each others work. We'll be digitizing in the same way you did for your island so part of this process is already familiar to you. However, we'll need to carefully digitize on top of a raster to have high quality data.
For 2025:
Previous classes have digitized a large amount of data for the campus. The goals this semester will be to:
- Make sure we have digitized rooms for all the major buildings on campus.
- Start to digitize rooms in additional buildings such as dorms.
- Make sure we have given the rooms the correct "name" (aka room number) so we can connect the room number to the Facilties Management database and determine which room names should be visible to the public, students and employees, and Faculties Management.
- Make sure the representation of additional features is uniform for all the major buildings.
QAQC
Go to the web page for the websites that are maintained by the Institute for Spatial Analysis Mapping and Modeling (ISAMM). Scroll down and click on the "New CPH Map". This is a map of campus that contains a lot of spatial data, most of which was contributed by CPH students.
Eventually, we want to have all the rooms on campus that are for activities, programs, and services digitized but that is a lot of rooms (i.e. we don't need to digitize storage rooms, equipment rooms, electrical rooms, etc.). For this semester, the goal is to make sure we have finished all of the floors that contain rooms that are usedfor activities, programs, and services except dorms. This year we are also starting to add dorms. First, we need to determine which buildings and which floors have been covered. There is a spreadsheet that tracks the status of the floors of each building. Unfortunately, the latest copy has gone missing so we will need to begin by updating the spreadsheet. It is in the project folder at:
G:\Shared drives\Graham Lab\Projects\CPH Web Map\Data\Rooms
Please coordinate with the other groups and then go through the map and the spreadsheet to find a couple of floors that need to be digitized. Add your initials in the "Checked out by" column. This indicates that you are working on the floor and keeps others from working on the same floor. Please remove your initials in the "Checked out by" column when you are done with a floor.
As you accomplish the steps below, you'll add your initials to the appropriate column in the spreadsheet.
Georeferencing an Image
If you need to digitize the rooms for a floor of building, you'll need a PDF of the layout of the floor. There are some PDFs of the building layouts in the Graham Lab folder at:
G:\Shared drives\Graham Lab\Projects\CPH Web Map\Data\Buildings\Floor Layout PDFs
If you do not see the one you need, you or Jim can also download layouts from the Facilities Link website. Please note that there is a specified format for the file names which is <BuildingName><BuildingLetter>-<FloorNumber>.<Extension>. In other words, the layout for Art A, floor 1 would be "ArtA-1.pdf". Not that G and B are used sometimes as floor numbers.
Note that these are typically only available to employees of the university. This is for security reasons so please do not distribute these beyond class and please delete them at the end of the lab.
A PDF is not much good to use in a GIS application so we'll need to convert it to a JPG and then georeference it to the earth.
- Open the PDF in Acrobat and zoom to make the layout as large as possible on your screen.
- Use the SnipIt tool to take a screen shot and save it as a JPG image with an appropriate name (e.g. ArtA-1.jpg)
- Drag and drop the JPG image into a map in ArcGIS Pro.
- Right now the image does not have a defined spatial reference system so it will appear off the coast of Africa.
- Right click on the image and select Properties. Then select "Source" and then "Spatial Reference". It should appear as "Unknown..." (shivers should run down your spine!).
- Load the 3" Arcata Aerial Image Data so you have a high accuracy dataset to georeference to.
- In the Analysis tab, open the Tools panel (which will be called Geo-processing).
- Search for Define Projection
- Select the Define Projection tool and project the JPG file to match the 3" Arcata Data (State Plane)
- Now examine where your file is located on your map. We fix this by georeferencing the image to the earth.
- Go to the web and search for "arcgis pro georeferencing". This will take you to the help pages from Esri on georeferencing.
- The steps below will take you through the process a bit faster but remember the pages above in case you need them in the future.
- Zoom into the building your are going to digitize floors for (i.e. were the layout should appear).
- Make sure to select the layout image rather than the 3" Arcata data for the next steps.
- In the Imagery tab, click on "Georeference"
- Click on the layout raster and click "Fit to Display". The layout raster should appear in your display over the location it needs to be georeferenced to, however, the fit will be very rough.
- Click on the Appearance tab and change the Transparency so you can see the building through the layout (about 50%).
- Click on "Add Control Points".
- Click on a building corner in your layout image (called "source" in ArcGIS terms) and make the layout hidden and click on the corresponding building corner in the Arcata image. When you make the layout visible, you should see the image shift.
- If you have a very rectangular building, you might be able to georeference it with just 4 corners. However, it typical takes 6 to 12.
- If you need to pan the map while georeferencing, hold down the "C" key and you'll see the mouse cursor become a hand. Then you can press and pan the map.
- Georeferencing can be done with a number of different mathematical functions and these are available in the "Transformations" menu. Since these images are for buildings with straight lines, you might want to stay with the 1st Order Polygon.
- When you feel good about the georeferencing, select "Save". You will then have a georeferenced raster file you can load into a GIS.
Don't worry if you need to do this several times. Get a feel for the number of points that are needed and feel free to just number the files (e.g. "ArtB-1_1.tif", "ArtB-1_2.tif") as needed.
Digitizing
- Create a polygon shapefile for the rooms in one of the floors for your building and name the shapefile with "<building>_<floor>.shp". For the first floor of the Forestry Building, this would be "Forestry_1.shp". For Natural Resources second floor, this would be "NaturalResources_1.shp". Please remove the spaces from the building names and use underscores to separate the floor number from the name. Just use "B" for floors that are basements.
- Digitize each of the rooms in the floor. Trace over the inside inner edge of the wall of the room. Trace across openings like doors and windows.
- Add a "name" attribute to the shapefile for the of the name of the room and then add the room name (aka room number) to the appropriate attribute. This is really important as this "name" is used to find the room both by users searching for it and by software that automatically updates the room data. Examples include:
- 104
- 101B
- 108
- Add a "descript" attribute for "description" to the shapefile for any additional description information you'd like to include. This information will be visible to the user when the room is clicked on. This might include:
- Womens restroom
- Prop room
- Lecture hall
- When done, save the data to the Working folder in:
- 2023 GSP 510 -> HSUData -> 2_Working -> Buildings -> <BuildingName>
- Where <BuildingName> is the name of your building
- Remember to go back and update the "Digitizer" and "Shapefile name" columns in the spreadsheet
- Each group should be able to finish at least one floor but some buildings are simpler than others so you may need to digitize more to meet the requirements in the assignment. However, reworking data is often as hard as doing it right the first time so please make sure your digitizing is accurate.
Metadata
Make sure to add the appropriate meta-data to your files. Using the ArcGIS Pro meta-data editor, make sure all the red "x"s are gone by filling in appropriate values for the meta data. The following steps will guide you through completing the "required" metadata from Esri and adding documentation for attributes including their units .
- In ArcGIS Pro, first make sure that you have closed all editing sessions and stopped georeferencing.
- Select the "Project" tab and then "Options".
- Scroll down to "Metadata" and select it.
- Select one of the ISO191115 "Metadata styles". This style includes fields form the International Standards Organization (IS0) version of FGDC metadata specification but it is in an Esri format. If you are ever required to provide true ISO or FGDC metadata, you'll need to do a conversion..
- Go to the Catalog in ArcGIS Pro. Note that there are options for metadata available when you right click on a layer in the Table of Contents but these are for metadata about the layer which I have never seen used. To edit the metadata for a feature layer (shapefile or raster), we need to use Catalog.
- Right click on the shapefile for the rooms in Catalog and select "Edit Metadata". You should see a window appear with the contents of the ISO metadata file on the left and red "x"s next to the elements that are required. Notice that the required items are also listed at the top of the panel for the currently selected element and the boxes where information is required are in red.
- In the "Overview" section:
- Add appropriate text to the boxes that are in red (i.e. "Title" should have a good title for the dataset and the "Description" should describe how it was created and for what purpose).
- As you enter the information and then move the next box to enter more data, the red should disappear. From here, your goal is to get rid of the red!
- In "Topics & Keywords", just select an appropriate "Topic Category".
- In "Citation", you'll need to click on the arrow next to "Dates" and then enter one or more dates.
- In the "Metadata" section:
- In "Details" select the language used for the metadata.
- In "Contacts", click on "New Contact" and enter your information.
- I do not require this but in a professional situation, you'll want to open "Contact Information" and provide appropriate information for them to contact you or another organizational representative.
- In the "Resource" section:
- In "Details", select the language used in the attributes.
- In "Extents", click on "New Extent". Typically you'll want to include a geography bounding box as this is a universal way to describe the location of the data and it will not change if the data is projected to another spatial reference.
- Click on "New Bounding Box".
- Click on the "Map" tab and make sure that the box showing the current coordinate at the bottom of the map is in decimal degrees. If not, right click on the arrow next to it and select "Decimal Degrees".
- Right click in the map near one of the corners of an imaginary bounding box that would surround your data and select "Copy Coordinate".
- Return to the metadata editor and paste the coordinate into "West". You'll need to remove the degree symbol and the "N" and "W" characters, convert the longitude to a negative number, and copy the coordinate value into the appropriate text box. Repeat this for the corner opposite the first one in your bounding box.
- At this point, all the red "x"s should be gone but we still need to add a description of our attributes and especially the units for the attribute values.
- Select "Fields" in the "Resource" section and then add a "New Entity and Attributes Details".
- A shapefile may have different types of features such as roads and trails. These are referred to as "entities" in the FGDC specification. For this shapefile, you can just have one entity, "Rooms". Since we only have rooms in this dataset "Definition" and "Definition Source" are really more than we need for this project so just enter "CPH Web Map Project" for both.
- For each attribute that you added (i.e. you do not have to add FID, Shape, or Id):
- Add a "New Attribute"
- The "Label" is the name of the attribute.
- The "Definition" and "Definition Source" can both be something like "CPH Web Map Project"
- The "Type" will be one of: Long, Text, Float, Double, Short, Long, or Date.
- The Width should be 254 or "Text" and blank for the other types but the editor will not allow a blank field so just add 1.
- Add a "New Range Domain" for any attribute values that you need to include units (i.e. area, length). This step is only needed if you added measured values to the dataset.
- The "Minimum" and "Maximum" fields have to be numbers with the minimum being less than the maximum. For attributes like area, just enter 0 for the minimum and a really large number for the maximum (it would be great if the editor supported "Infinity" but it does not).
- Enter the appropriate "Units" (e.g. "meters", "feet", etc.).
Deploying (Optional)
Shapefiles are the most common file format for vector data in GIS until we want to display data in a website. For this, GeoJSON (geographic JavaScript Object Notation) is the most common format. GeoJSON is a text file so you can open the files and see the data in an editor like NotePad. The CPH map keeps most of its spatial data in this format.
ArcGIS Pro does not directly support GeoJSON but QGIS does so we'll be converting the shapefiles to GeoJSON in QGIS. QGIS also allows us to edit the spatial data and attributes quite easily and I use it to edit the files in the map directly.
The Web Mercator projection is the most messed up projection in both its accuracy and how it is supported. There are about six versions of the Web Mercator spatial reference and different ones work with different GIS software. The only spatial reference I have been able to get to work reliably with QGIS and Web Mercator is: ESRI:102100 - WGS_1984_Web_Mercator_Auxillary_Sphere.
We'll need to project the data to Web Mercator and then store the data in the web map folder and link it to the website.
- Open QGIS.
- Drag and drop your data into QGIS.
- Right click on the layer and select "Export-> Save Features As".
- Select "GeoJSON" or geographic JavaScript Object Notation as the file type. This is the main file format for vector spatial data on the web and is increasing in popularity in other areas.
- Give the file the name matching the room and floor as above and ending in ".geojson".
- Click on the world icon to the right of the CRS pop up.
- Enter "web" in the search field.
- Select ESRI:102100 - WGS_1984_Web_Mercator_Auxillary_Sphere and click "OK".
- Click OK
- Go to the folder were you saved your geojson file and open it in Notepad.
- The GeoJSON file is contains very similar data to a shapefile but in a different format and all in one file. Also, it is a text file which makes it slower for computers to read and write but much easier for humans to read.
- The "type" is the type of file as GeoJSON files can contain just one "Point" or an entire "FeatureCollection"
- FeatureCollections have an array of features and each feature has properties (attributes in GIS) and a geometry.
- The properties are organized in a JSON object (see W3Schools for more info) where each entry has a "key" and a "value". The keys are the names of the attributes and the values are the values for the attributes.
- The geometry can be a number of different types but each contains arrays of coordinates with the points that make up the geometry. The different types of geometries are defined by the Well-known text representation of geometry (or WKT). Don't worry if you have not heard of it, very few folks outside of the GIS open source world have.
- In addition, the JSON file can have additional entries:
- Name: typically matches the name of the file
- crs: Coordinate reference system (aka spatial reference system). There are a number of accepted formats for this but many of the have EPSG codes which are well defined.
- Since the geojson file is just one file, you can turn it in without zipping it.
Additional Resources
W3Schools - great free online tutorials on a range of technologies including JavaScript.